<template>
  <div class="app-container">
  <Article @article="addArticle"></Article>
  </div>
</template>

<script>
import Article from '@/components/article'
import { addBlog } from '@/api/blog'

export default {
  name: 'Index',
  components: {
    Article
  },
  methods: {
    addArticle(data) {
      addBlog(data.data).then(() => {
        this.$router.push('/article/list')
        this.$message.success('添加成功')
      })
    }
  }
}
</script>

<style scoped>

</style>
